package com.college.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="PAPER_MASTER")
public class Paper implements Serializable {

	private static final long serialVersionUID = 5624361831551833717L;
	
	private Integer paperId;
	private Semester semester;
	private Faculty facultyId;
	private FacultyGroup facultyGrpId;
	private String paperName;
	private String paperDesc;
	
	public Paper(){
		
	}


	public Paper(Integer paperId, Semester semester, Faculty facultyId,
			FacultyGroup facultyGrpId, String paperName, String paperDesc) {
		super();
		this.paperId = paperId;
		this.semester = semester;
		this.facultyId = facultyId;
		this.facultyGrpId = facultyGrpId;
		this.paperName = paperName;
		this.paperDesc = paperDesc;
	}



	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name="PAPER_ID")
	public Integer getPaperId() {
		return paperId;
	}

	public void setPaperId(Integer paperId) {
		this.paperId = paperId;
	}
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="SEMESTER_ID", referencedColumnName="SEMESTER_ID")
	public Semester getSemester() {
		return semester;
	}

	public void setSemester(Semester semester) {
		this.semester = semester;
	}
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="FACULITY_ID", referencedColumnName="FACULITY_ID")
	public Faculty getFacultyId() {
		return facultyId;
	}

	public void setFacultyId(Faculty facultyId) {
		this.facultyId = facultyId;
	}
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="FACULITY_GROUP_ID", referencedColumnName="FACULITY_GROUP_ID")
	public FacultyGroup getFacultyGrpId() {
		return facultyGrpId;
	}

	public void setFacultyGrpId(FacultyGroup facultyGrpId) {
		this.facultyGrpId = facultyGrpId;
	}
	@Column(name="PAPER_NAME")
	public String getPaperName() {
		return paperName;
	}

	public void setPaperName(String paperName) {
		this.paperName = paperName;
	}
	@Column(name="PAPER_DESC")
	public String getPaperDesc() {
		return paperDesc;
	}

	public void setPaperDesc(String paperDesc) {
		this.paperDesc = paperDesc;
	}
	
	
}
